﻿using System;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace OCXS.OCXSServiceLibrary.Administration {

    /// <summary>
    /// Message contract for <c>UpdateVariable</c>'s service method.
    /// </summary>
    [MessageContract(
        WrapperName = "UpdateVariables",
        WrapperNamespace = "http://OCXS.org/Administration/",
        IsWrapped = true)]
    public class UpdateVariablesRequest { 

    }

    /// <summary>
    /// Message contract for <c>UpdateVariable</c>'s service method.
    /// </summary>
    [MessageContract(
            WrapperName = "UpdateVariablesResponse",
            WrapperNamespace = "http://OCXS.org/Administration/",
            IsWrapped = true)]
    public class UpdateVariablesResponse {

        /// <summary>
        /// Variable names.
        /// </summary>
        private string[] variableNames;

        /// <summary>
        /// Variable values.
        /// </summary>
        private float[] variableValues;

        /// <summary>
        /// Variable types.
        /// </summary>
        private string[] variableTypes;

        /// <summary>
        /// Variable descriptions.
        /// </summary>
        private string[] variableDescriptions;

        /// <summary>
        /// Gets or Sets variable names.
        /// </summary>
        [MessageBodyMember(Name = "VariableNames", Order = 0)]
        public string[] VariableNames {
            get { return this.variableNames; }
            set { this.variableNames = value; }
        }

        /// <summary>
        /// Gets or Sets variable values.
        /// </summary>
        [MessageBodyMember(Name = "VariableValues", Order = 1)]
        public float[] VariableValues {
            get { return this.variableValues; }
            set { this.variableValues = value; }
        }

        /// <summary>
        /// Gets or Sets variable types.
        /// </summary>
        [MessageBodyMember(Name = "VariableTypes", Order = 2)]
        public string[] VariableTypes {
            get { return this.variableTypes; }
            set { this.variableTypes = value; }
        }
         
        /// <summary>
        /// Gets or Sets variable descriptions.
        /// </summary>
        [MessageBodyMember(Name = "VariableDescriptions", Order = 3)]
        public string[] VariableDescriptions {
            get { return this.variableDescriptions; }
            set { this.variableDescriptions = value; }
        }

        /// <summary>
        /// Default constructor.
        /// </summary>
        public UpdateVariablesResponse() {
            this.variableNames = null;
            this.variableValues = null;
            this.variableTypes = null;
            this.variableDescriptions = null;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="names">Variable names.</param>
        /// <param name="values">Variable values.</param>
        /// <param name="types">Variable types</param>
        /// <param name="descriptions">Variable descriptions.</param>
        public UpdateVariablesResponse(string[] names, float[] values, string[] types, string[] descriptions) {
            this.variableNames = names;
            this.variableValues = values;
            this.variableTypes = types;
            this.variableDescriptions = descriptions;
        }

    }

    /// <summary>
    /// Message contract for <c>UpdateSubscription</c>'s service method.
    /// </summary>
    [MessageContract(
        WrapperName = "UpdateSubscriptions",
        WrapperNamespace = "http://OCXS.org/Administration/",
        IsWrapped = true)]
    public class UpdateSubscriptionRequest { 
    
    }

    /// <summary>
    /// Message contract for <c>UpdateSubscription</c>'s service method.
    /// </summary>
    [MessageContract(
            WrapperName = "UpdateSubscriptionsResponse",
            WrapperNamespace = "http://OCXS.org/Administration/",
            IsWrapped = true)]
    public class UpdateSubscriptionsResponse {

        /// <summary>
        /// Subscription ids.
        /// </summary>
        private string[] sids;

        /// <summary>
        /// Subscription disposed statuses.
        /// </summary>
        private bool[] disposed;

        /// <summary>
        /// Subscription variable ids array.
        /// </summary>
        private string[][] variableIds;

        /// <summary>
        /// Gets or Sets subscription ids.
        /// </summary>
        [MessageBodyMember(Name = "SubscriptionIDs", Order = 0)]
        public string[] SIDs {
            get { return this.sids; }
            set { this.sids = value; }
        }

        /// <summary>
        /// Gets or Sets disposed statuses.
        /// </summary>
        [MessageBodyMember(Name = "SubscriptionDisposed", Order = 0)]
        public bool[] Disposed {
            get { return this.disposed; }
            set { this.disposed = value; }
        }

        /// <summary>
        /// Gets or Sets variable ids array.
        /// </summary>
        [MessageBodyMember(Name = "VariableIDs", Order = 2)]
        public string[][] VariableIDs {
            get { return this.variableIds; }
            set { this.variableIds = value; }
        }

        /// <summary>
        /// Default constructor.
        /// </summary>
        public UpdateSubscriptionsResponse() {
            this.sids = null;
            this.disposed = null;
            this.variableIds = null;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="sids">Subscription ids.</param>
        /// <param name="disposed">Subscription disposed statuses.</param>
        /// <param name="varIds">Subscription variable ids array.</param>
        public UpdateSubscriptionsResponse(string[] sids, bool[] disposed, string[][] varIds) {
            this.sids = sids;
            this.disposed = disposed;
            this.variableIds = varIds;
        }

    }

    /// <summary>
    /// Message contract for <c>UpdateServerStatus</c>'s service method.
    /// </summary>
    [MessageContract(
        WrapperName = "UpdateServerStatus",
        WrapperNamespace = "http://OCXS.org/Administration/",
        IsWrapped = true)]
    public class UpdateServerStatusRequest {

    }

    /// <summary>
    /// Message contract for <c>UpdateServerStatus</c>'s service method.
    /// </summary>
    [MessageContract(
        WrapperName = "UpdateServerStatusResponse",
        WrapperNamespace = "http://OCXS.org/Administration/",
        IsWrapped = true)]
    public class UpdateServerStatusResponse {

        /// <summary>
        /// Number of subscriptions.
        /// </summary>
        private int subscriptionNum;

        /// <summary>
        /// Number of variables.
        /// </summary>
        private int variablesNum;

        /// <summary>
        /// Number of generator threads.
        /// </summary>
        private int generatorThreadNum;

        /// <summary>
        /// Number of subscription watcher threads.
        /// </summary>
        private int subscriptionWatcherThreadNum;

        /// <summary>
        /// Number of Garbage Collector collected items.
        /// </summary>
        private int gcCollectionNum;

        /// <summary>
        /// Amount of Garbage Collector freed memory.
        /// </summary>
        private long gcTotalMemory;

        /// <summary>
        /// Gets or Sets number of subscriptions.
        /// </summary>
        [MessageBodyMember(Name = "SubscriptionNum", Order = 0)]
        public int SubscriptionNum {
            get { return this.subscriptionNum; }
            set { this.subscriptionNum = value; }
        }

        /// <summary>
        /// Gets or Sets number of variables.
        /// </summary>
        [MessageBodyMember(Name = "VariablesNum", Order = 1)]
        public int VariablesNum {
            get { return this.variablesNum; }
            set { this.variablesNum = value; }
        }

        /// <summary>
        /// Gets or Sets number of generator threads.
        /// </summary>
        [MessageBodyMember(Name = "GeneratorThreadNum", Order = 2)]
        public int GeneratorThreadNum {
            get { return this.generatorThreadNum; }
            set { this.generatorThreadNum = value; }
        }

        /// <summary>
        /// Gets or Sets number of subscription watcher threads.
        /// </summary>
        [MessageBodyMember(Name = "SubscriptionWatcherThreadNum", Order = 3)]
        public int SubscriptionWatcherThreadNum {
            get { return this.subscriptionWatcherThreadNum; }
            set { this.subscriptionWatcherThreadNum = value; }
        }

        /// <summary>
        /// Gets or Sets number of Garbage Collector collected items.
        /// </summary>
        [MessageBodyMember(Name = "GCCollectionNum", Order = 4)]
        public int GCCollectionNum {
            get { return this.gcCollectionNum; }
            set { this.gcCollectionNum = value; }
        }

        /// <summary>
        /// Gets or Sets amount of Garbage Collector freed memory.
        /// </summary>
        [MessageBodyMember(Name = "GCTotalMemory", Order = 5)]
        public long GCTotalMemory {
            get { return this.gcTotalMemory; }
            set { this.gcTotalMemory = value; }
        }

        /// <summary>
        /// Default Constructor.
        /// </summary>
        public UpdateServerStatusResponse() {
            this.gcCollectionNum = 0;
            this.gcTotalMemory = 0L;
            this.generatorThreadNum = 0;
            this.subscriptionNum = 0;
            this.subscriptionWatcherThreadNum = 0;
            this.variablesNum = 0;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="varNum">Number of variables.</param>
        /// <param name="subWatcherTNum">Number of variable watcher threads.</param>
        /// <param name="subNum">Number of subscriptions.</param>
        /// <param name="genTNum">Number of variable generators.</param>
        /// <param name="gcTotMem">Amount of Garbage Collector freed memory.</param>
        /// <param name="gcCollNum">Number of Garbage Collector collected items.</param>
        public UpdateServerStatusResponse(int varNum, int subWatcherTNum, int subNum, int genTNum, long gcTotMem, int gcCollNum) {
            this.gcCollectionNum = gcCollNum;
            this.gcTotalMemory = gcTotMem;
            this.generatorThreadNum = genTNum;
            this.subscriptionNum = subNum;
            this.subscriptionWatcherThreadNum = subWatcherTNum;
            this.variablesNum = varNum;
        }

    }

} /* OCXS.OCXSServiceLibrary.Administration */
